import http from "../http/http.js"

/* 获取当前城市 */
export function getCity() {
  return http("get", "v1/cities?type=guess")
}

/* 获取全部城市 */
export function getCityAll() {
  return http("get", "v1/cities?type=group")
}

/* 获取热门城市 */
export function getHotCity() {
  return http("get", "v1/cities?type=hot")
}

/* 搜索 */
export function getSearch(id, value) {
  return http("get", "v1/pois?type=search&" +
    "city_id=" +
    id +
    "&keyword=" +
    value)
}

/* 分页器 */
export function pageNumber(jing, wei, Number, set) {
  return http("get", 'shopping/restaurants?latitude=' + jing + '&longitude=' + wei + '&offset=' + Number + ' &limit=' + set + '&extras[]=activities&keyword=&restaurant_category_id=&restaurant_category_ids[]=&order_by=&delivery_mode[]=')
}

/* 新分页器 */
export function pageNumberr(id) {
  return http("get", 'shopping/restaurants?latitude=47.34288&longitude=124.029569&offset=0&limit=20&extras[]=activities&keyword=&restaurant_category_id=&restaurant_category_ids[]=' + id + '&order_by=null&delivery_mode[]=null')
}

/* 分类 */
export function pageFenlei(id, by) {
  return http("get", 'shopping/restaurants?latitude=47.34288&longitude=124.029569&offset=0&limit=20&extras[]=activities&keyword=&restaurant_category_id=&restaurant_category_ids[]=' + id + '&order_by=' + by + '&delivery_mode[]=null')
}

/* 新的搜索 */
export function getsearch(value, search) {
  return http("get", 'v4/restaurants?extras[]=restaurant_activity&geohash=' + search + '&keyword=' + value + '&type=search')
}

/* 商品分类 */
export function getfenlei(latitude, longitude) {
  return http("get", "shopping/v2/restaurant/category?latitude=" + latitude + "&longitude=" + longitude + "")
}

/* 筛选 */
export function getshaixuan() {
  return http("get", "shopping/v1/restaurants/activity_attributes?latitude=41.06889&longitude=122.962617&kw=")
}

/* 蜂鸟专送 */
export function getfengniao() {
  return http("get", "shopping/v1/restaurants/delivery_modes")
}

/* 最后的提交 */
export function gettijiao(id, by, arr) {
  return http("get", 'shopping/restaurants?latitude=47.34288&longitude=124.029569&offset=0&limit=20&extras[]=activities&keyword=&restaurant_category_id=&restaurant_category_ids[]=' + id + '&order_by=' + by + arr)
}

/* 购买 */
export function getgoumai(value) {
  return http("get", "shopping/v2/menu?restaurant_id=" + value + "")
}

/* 验证码图片 */
export function yanzheng() {
  return http('post', 'v1/captchas')
}

/* 验证码 */
export function jianyan(data) {
  return http('post', 'v2/login', data)
}

/* 登录判断 */
export function denglu(data) {
  return http('post', 'v2/changepassword', data)
}

/* 员工信息 */
export function yuangong() {
  return http('get', '/api/user?page=1&limit=10&status=&nickname=&mobile=&')
}
